package soap.commons;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 放行路由
 * @Author ZhangPY
 * @Date 2020/6/24
 */
public enum ReleaseRoute {
    // 用户登录
    USER_ACCREDIT(1, "/ms/user/user/accredit"),
    // 查询用户权限
    GET_USER_PERMISSION(1, "/ms/user/userPermission/getUserPermissionsGet"),
    // 模块日志
    PLUMELOG_LOG_WATCH(1,"/ms/**/plumelog/**"),
    // swagger
    SWAGGER(1,"/ms/**/v2/api-docs"),
    // 微信回调
    WECHAT_ACCREDIT(1, "/ms/user/user/WxCallback");

    private Integer code;
    private String path;

    public static Map<String, Integer> getAllPath() {
        Map<String, Integer> pathMap = new HashMap<>();
        for (ReleaseRoute value : ReleaseRoute.values()) {
            pathMap.put(value.path, value.code);
        }
        return pathMap;
    }


    ReleaseRoute(Integer code, String path) {
        this.code = code;
        this.path = path;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
